function $(id){return document.getElementById(id);}
var inp;
var result;
function display (inp0) {
    inp = document.getElementById("text");
    inp.value = inp.value + inp0;
};

function equal () {
    inp = document.getElementById("text");
    result = eval(inp.value);
    inp.value = result;
}

function back () {
    inp = document.getElementById("text");
    inp.value = inp.value.substring(0,inp.value.length-1);
}

function reset() {
    inp = document.getElementById("text");
    inp.value = "";
}